package com.wing.wcabinet.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wing.cabinet.model.entity.CabinetCargoSpace;
import com.wing.cabinet.model.entity.CellInventoryInout;
import com.wing.cabinet.model.entity.StorageInventoryInout;
import com.wing.cabinet.model.entity.UseInventoryInout;
import com.wing.cabinet.model.request.CellInventoryInoutDetailForm;
import com.wing.cabinet.model.request.CellInventoryInoutForm;
import com.wing.cabinet.model.request.StorageInventoryInoutForm;
import com.wing.cabinet.model.response.CabinetCargoLaneVO;
import com.wing.common.utils.JsonResult;
import com.wing.order.model.request.OrderReceiveLoadForm;
import com.wing.wcabinet.model.entity.WcabCellInventoryInout;
import com.wing.wcabinet.model.entity.WcabCellInventoryInoutDetail;
import com.wing.wcabinet.model.entity.WcabCellLoadDetail;
import com.wing.wcabinet.model.entity.WcabUseInventoryInout;
import com.wing.wcabinet.model.request.WcabCellInventoryInoutDetailForm;
import com.wing.wcabinet.model.request.WcabCellInventoryInoutForm;
import com.wing.wcabinet.model.request.WcabCellLoadDetailForm;
import com.wing.wcabinet.model.request.WcabCellLoadForm;
import com.wing.wcabinet.model.response.WcabCellInventoryInoutDetailVO;

import java.io.IOException;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 售刀柜上货(上货主表无展示)/领取明细-Service
 *
 * @author
 */
public interface WcabCellInventoryInoutDetailService extends IService<WcabCellInventoryInoutDetail> {

    /**
     * 添加
     *
     * @param wcabCellInventoryInoutDetailForm
     * @return
     */
    int add(WcabCellInventoryInoutDetailForm wcabCellInventoryInoutDetailForm);

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<WcabCellInventoryInoutDetailVO> list4app(Map<String, Object> params);

    /**
     * 分页list-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    Page<WcabCellInventoryInoutDetailVO> pageList4app(Page page, Map<String, Object> params);

    Page<WcabCellInventoryInoutDetailVO> pageList(Page page, Map<String, Object> params);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    WcabCellInventoryInoutDetailVO get4appById(Long id);

    void inventoryIn4Batch(OrderReceiveLoadForm orderReceiveLoadForm);

    void inventoryIn4Batch(WcabCellLoadForm orderReceiveLoadForm);



    void inventoryOutIn(WcabCellInventoryInoutForm cellInventoryInoutForm);

    void inventoryIn(WcabCellLoadDetailForm wcabCellLoadDetailForm);

    void inventoryOut4Batch(OrderReceiveLoadForm orderReceiveLoadForm);

    void inventoryOut4Batch(WcabCellLoadForm orderReceiveLoadForm);

    void inventoryOut(WcabCellLoadDetailForm orderReceiveLoadForm);
    void inventoryOut4Empty(WcabCellLoadDetailForm orderReceiveLoadForm);

    void inventoryIn(WcabCellInventoryInoutForm cellInventoryInoutForm);

    void inventoryOut(WcabCellInventoryInoutForm cellInventoryInoutForm);

    WcabCellInventoryInout inventoryOut(List<WcabCellInventoryInoutDetailForm> list, String deviceCode, WcabCellInventoryInout.BusinessType businessType,WcabCellInventoryInout.OperationType operationType,Long storesRequisitionId);

    WcabCellInventoryInout inventoryOut(String cabCode,String spaceCode,WcabCellInventoryInout.OperationType operationType,String deviceCode);


    boolean check4Wx(WcabCellInventoryInoutForm storageInventoryInoutForm) throws IOException;

    boolean check(WcabCellInventoryInoutForm storageInventoryInoutForm);

    WcabCellInventoryInout inventoryOut4Check(List<WcabCellInventoryInoutDetailForm> list, WcabCellInventoryInout.BusinessType businessType,Long checkedResultId,WcabCellInventoryInout.OperationType businessDetailType,WcabCellInventoryInout.BusinessTypeChecked businessTypeChecked,Long checkedInventoryInoutId);

    WcabCellInventoryInout inventoryOut4CheckOffsetQuantity(List<WcabCellInventoryInoutDetailForm> list, WcabCellInventoryInout.BusinessType businessType,Long checkedResultId,WcabCellInventoryInout.OperationType businessDetailType,WcabCellInventoryInout.BusinessTypeChecked businessTypeChecked,Long checkedInventoryInoutId);
    WcabCellInventoryInout inventoryOut4CheckOffsetWeight(List<WcabCellInventoryInoutDetailForm> list, WcabCellInventoryInout.BusinessType businessType,Long checkedResultId,WcabCellInventoryInout.OperationType businessDetailType,WcabCellInventoryInout.BusinessTypeChecked businessTypeChecked,Long checkedInventoryInoutId);
    WcabCellInventoryInout inventoryIn4CheckOffsetQuantity(List<WcabCellInventoryInoutDetailForm> list, WcabCellInventoryInout.BusinessType businessType,Long checkedResultId,WcabCellInventoryInout.OperationType businessDetailType,WcabCellInventoryInout.BusinessTypeChecked businessTypeChecked,Long checkedInventoryInoutId);
    WcabCellInventoryInout inventoryIn4CheckOffsetWeight(List<WcabCellInventoryInoutDetailForm> list, WcabCellInventoryInout.BusinessType businessType,Long checkedResultId,WcabCellInventoryInout.OperationType businessDetailType,WcabCellInventoryInout.BusinessTypeChecked businessTypeChecked,Long checkedInventoryInoutId);



    void inventoryIn4Check(List<WcabCellInventoryInoutDetailForm> list,Long checkedResultId, WcabCellInventoryInout.BusinessType businessType,WcabCellInventoryInout.OperationType businessDetailType,WcabCellInventoryInout.BusinessTypePre businessTypePre,Long storageInventoryOutId,Long storageInventoryCheckId);

    void inventoryIn4CheckQuantity(List<WcabCellInventoryInoutDetailForm> list,Long checkedResultId, WcabCellInventoryInout.BusinessType businessType,WcabCellInventoryInout.OperationType businessDetailType,WcabCellInventoryInout.BusinessTypePre businessTypePre,Long storageInventoryOutId,Long storageInventoryCheckId);

    void inventoryIn4CheckWeight(List<WcabCellInventoryInoutDetailForm> list,Long checkedResultId, WcabCellInventoryInout.BusinessType businessType,WcabCellInventoryInout.OperationType businessDetailType,WcabCellInventoryInout.BusinessTypePre businessTypePre,Long storageInventoryOutId,Long storageInventoryCheckId);

    void inventoryIn4CheckQuantityWeight(List<WcabCellInventoryInoutDetailForm> list,Long checkedResultId, WcabCellInventoryInout.BusinessType businessType,WcabCellInventoryInout.OperationType businessDetailType,WcabCellInventoryInout.BusinessTypePre businessTypePre,Long storageInventoryOutId,Long storageInventoryCheckId);
    void inventoryOut4CheckQuantityWeight(List<WcabCellInventoryInoutDetailForm> list,Long checkedResultId, WcabCellInventoryInout.BusinessType businessType,WcabCellInventoryInout.OperationType businessDetailType,WcabCellInventoryInout.BusinessTypePre businessTypePre,Long storageInventoryOutId,Long storageInventoryCheckId);


    List<CabinetCargoLaneVO> getSpaces(String cabCodes, String skuCode, WcabCellInventoryInout.BusinessType businessType, List<Integer> spaceTypes, BigDecimal weight);

    List<CabinetCargoLaneVO> getOptimalSpaces(String cabCodes, String skuCode, WcabCellInventoryInout.BusinessType businessType, List<Integer> spaceTypes, BigDecimal weight,Integer quantity);

    List<CabinetCargoLaneVO> getReturnOptimalSpaces(String cabCodes, String skuCode, WcabCellInventoryInout.BusinessType businessType, List<Integer> spaceTypes, BigDecimal weight,Integer quantity);

    JsonResult verifyPermissions(String skuCode,String cabCode);
}
